
const app = getApp()

Page({
  data: {
    newsList: [],
    loading: true,
  },
  async onLoad() {
    const self = this
    try {
      const res = await app.ajax({
        url: 'http://localhost:8888/news',
        method: 'GET',
      })
      self.setData({
        newsList: res.data
      })
    } catch (e) {

    } finally {
      self.setData({
        loading: false
      })
    }
  },
})
